<?php
declare (strict_types = 1);

namespace app\model;

use think\facade\Db;
use think\Model;

/**
 * @mixin \think\Model
 */
class Setting extends Model
{

    public static function homeDetail($page) {
        $data = Db::name('setting')->find(['page' => $page]);
        if($data['slogan']) {
            $data['slogan'] = explode('$8$',$data['slogan']);
            $len = count($data['slogan']);
            if($data['slogan'][$len-1] == '') {
                array_pop($data['slogan']);
            }
        } else {
            $data['slogan'] = [];
        }
        return $data;
    }
}
